package com.yuyu.commons.es;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.stereotype.Service;

/**
 * @author es HighClient
 * @version 1.0
 * @description: TODO
 * @date 2022/8/2 10:32
 */
@Service
public class EsHighClient extends RestHighLevelClient {

    public EsHighClient(RestClientBuilder restClientBuilder) {
        super(restClientBuilder);
    }

    public RestHighLevelClient restHighLevelClient(){
        return new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost",9200,"http")));
    }
}
